<script src="__STATIC__/storage/cos-js-sdk-v5.min.js"></script>
<script>
	var Path = '/';
    var Bucket = '{:config("storage.cos.bucket")}';
    var Region = '{:config("storage.cos.region")}';
    // 初始化实例
    var cos = new COS({
        getAuthorization: function (options, callback) {
            var url = '{:url("fun/CosSts")}';
            var xhr = new XMLHttpRequest();
            xhr.open('GET', url, true);
            xhr.onload = function (e) {
                try {
                    var data = JSON.parse(e.target.responseText);
                } catch (e) {
                }
                callback({
                    TmpSecretId: data.credentials && data.credentials.tmpSecretId,
                    TmpSecretKey: data.credentials && data.credentials.tmpSecretKey,
                    XCosSecurityToken: data.credentials && data.credentials.sessionToken,
                    ExpiredTime: data.expiredTime,
                });
            };
            xhr.send();
        }
    });
</script>
<script src="__STATIC__/ckeditor/ckeditor.js"></script>
<script>
    //基础配置
    var CONFIG = {
        upImgUrl: '{:url("fun/up_img")}',  //图片上传
        ckeditor: {
            extraPlugins: 'uploadimage,cosimg',
            imageUploadUrl: '{:url("fun/ckeditor_upimg")}',
            filebrowserUploadUrl: '{:url("fun/ckeditor_upimg")}',
            height: 400
        }
    }
</script>